// filaname: string_utf_convert.cpp
// authro: enic
// date: 2015-05-13

#pragma once

#include "string_utf_convert.h"

namespace X
{

	std::string U16ToUtf8(const std::wstring strUtf16)
	{
		std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>, wchar_t> cvt;
		std::string strUtf8 = cvt.to_bytes(strUtf16); // utf-16 to utf-8

		return strUtf8;
	}

	std::wstring U8ToUtf16(const std::string strUtf8)
	{
		std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>, wchar_t> cvt;
		std::wstring strUtf16 = cvt.from_bytes(strUtf8); // utf-8 to utf-16

		return strUtf16;
	}

};